package ui.panels
{
	import flash.display.Bitmap;
	import flash.display.Sprite;
	
	import global.Managers;
	
	import lang.Language;

	public class AbstractPanel extends Sprite
	{
		protected var _type						: int;
		protected var _bg						: Bitmap;
		
		protected var _currentLanguage			: int = Language.CN;
		
		public function get currentLanguage():int {
			return _currentLanguage;
		}
		
		public function get type():int {
			return _type;
		}
		public function get panelWidth():Number {
			return _bg.width;
		}
		public function get panelHeight():Number {
			return _bg.height;
		}
		
		public function AbstractPanel(type:int)
		{
			super();
			
			_type = type;
			
			_bg = new Bitmap();
			addChild(_bg);
		}
		
		public function openHandler():void {
			switchLanguage(Managers.languageManager.currentLanguage);
			// 打开面板后的操作，留待子类完善
		}
		public function closeHandler():void {
			// 关闭面板后的操作，留待子类完善
		}
		public function switchLanguage(toLanguage:int):void {
			// 该方法接下来的工作是负责更新Panel内所有语言文字，留给子类完善
		}
	}
}